<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./styles/general.css" rel="stylesheet" type="text/css" />
<link href="./styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/jquery.js"></script>
<style>
table tr td{ text-align:center;}
</style>

<title></title>
</head>
<script type="text/javascript">
	function delproduct(product_id)
	{   
		if(window.confirm('是否要删除本条产品信息，删除后无法恢复！'))
		{

			$.get("/wondershare/product.php?action=DelProduct", { product_id: product_id},
            function(data){
                   if(data == 'success')
				   {
				     $("#product_"+product_id).remove();
					 $("#total").html(parseInt($("#total").html())-1);
				   }else
				   {
				      alert("由于系统原因，不能删除，请联系管理员！");
				   }
	
		    });
		}
		else
		{
			return false;
		}
	}
	function addnewproduct(url)
	{
		location.href=url;
	}
	function all_cbs()
	{
       $("#cbs_all").show();
	   $.get("/wondershare/product.php?action=Sync_Product_All",
        function(data){

	         alert("全部同步完毕！");
			 $("#cbs_all").hide();
		 });
	}
</script>
<body>
<h1>

<span class="action-span">
<a href="./product_operation.php?action=index&type=add">添加新产品</a>
</span>
<span class="action-span">

<a href="javascript:void(0);" onclick="all_cbs();">同步全部cbs产品</a>
</span>

<span class="action-span">
<a href="http://cms.wondershare.com/wondershare/product_pad.php?action=batch_pad" >批量生成WonderSharePAD文件</a>
</span>

<span class="action-span" id='cbs_all' style="display:none">
请不要离开此页面，正在同步......
</span>

<span class="action-span1">
<a href="i#">公共产品管理</a>
</span>
<span id="search_id" class="action-span1"> - 产品列表 </span>
<div style="clear:both"></div>
</h1>

<form method="POST" action="./product.php?action=SearchProductList ">
    <img height="22" border="0" width="26" alt="SEARCH" src="../images/icon_search.gif">
    <!-- 推荐 -->
    &nbsp;&nbsp;产品品牌<select name="product_brand">
    <{foreach from=$product_brand_arr key=myID item=brand}>
    <option value="<{$brand.product_brand}>" <{if $brand.product_brand==$product_brand}>selected="selected"<{/if}>><{$brand.product_brand}></option>
    <{/foreach}>
    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    产品搜索<select name="search_type">
    <option value="0" <{if $search_type==0}>selected="selected"<{/if}>>产品名称</option>
    <option value="1" <{if $search_type==1}>selected="selected"<{/if}>>CBS产品ID</option>
    </select>&nbsp;&nbsp;
        <!-- 关键字 -->
    <input type="text" size="25" name="search_key" value="<{$search_key}>"><input type="submit" class="button" name="search" value=" 搜索 ">

</form>
  <{if count($productlist)<=0}>
  <h2 style="text-align:center;">没有数据</h2>
  <{else}>
  <table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="list-div">
    <tr>
      <th width="6%">产品序号</th>
      <th width="6%">CBS产品ID</th>
      <th>产品名称</th>
      <th width="8%">操作人员</th>
      <th width="8%">操作时间</th>
      <th width="19%">操作</th>
     <{if $is_show_price == 1}> <th width="9%">价格管理</th> <{/if}>
      <th width="9%">版本管理</th>
      <th width="9%">评论管理</th>
    </tr>
    <{foreach from=$productlist key=myID item=product}>
    <tr id="product_<{$product.product_id}>">
      <td><{$product.product_id}></td>
      <td><{$product.product_cbsid}></td>
      <td style="text-align:left;padding-left:8px;"><{$product.product_name}></td>
      <td><{$product.product_add_user}></td>
      <td><{$product.product_add_time}></td>
      <td><a href="./product_operation.php?action=index&type=update&product_id=<{$product.product_id}>">详情</a>
      &nbsp;|&nbsp;<a onclick="delproduct(<{$product.product_id}>);" href="javascript:void(0);">删除</a>
	  &nbsp;|&nbsp;   <a href="./product_pad.php?action=create_xml&product_id=<{$product.product_id}>">PAD生成</a></td>
      <{if $is_show_price == 1}>
	  <td><a href="./product.php?action=ManagePrice&product_id=<{$product.product_id}>">价格管理</a></td>
	  <{/if}>
      <td><a href="./product.php?action=ManageVersion&product_id=<{$product.product_id}>">版本管理</a></td>
      <td><a href="./comment.php?action=index&product_id=<{$product.product_id}>">评论管理</a></td>
    </tr>
    <{/foreach}>
    <tr>
    <td colspan="11" align="left"><{$page_url}> &nbsp;&nbsp;&nbsp; 共有 <span id="total"><{$total}></span>条记录</td>
    </tr>
  </table>
  <{/if}>
</body>
</html>
